/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Donnee;

import Modele.Lapin;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Zanna Bianca
 */
public class Joueur implements Action{
    
   /*
    * La classe qui déterminer les actions et les profiles des joueurs
    */
    public static final int COMMENCER = 0;
    public static final int BOUGERLAPIN = 1;
    public static final int CHOISIRPONT = 2;
    public static final int TERMINER = 3;
    private String nom;
    private String prenom;
    private int age;
    private String email;
    private int tour;
    private List<Lapin> lapin;
    private boolean defeat = false;
    public Joueur(String nom, String prenom, int age, String email){
        this.nom = nom;
        this.prenom = prenom;
        this.age = age;
        this.email = email;
        this.lapin = new ArrayList<>();
        
    }
    @Override
    public void bougerLapin(){
        this.tour += BOUGERLAPIN;
    }
    @Override
    public void choisirPont(){
        System.out.println(this.getNom() + " a bloque ce pont par une barrière");
        this.tour += CHOISIRPONT;
    }
    
    public void commencerTour(){
        this.setTour(COMMENCER);
    }

    

    
    public boolean tourTerminer(){
        return(this.getTour() >= TERMINER);
    }

    /**
     * @return the tour
     */
    public int getTour() {
        return tour;
    }

    /**
     * @param tour the tour to set
     */
    public void setTour(int tour) {
        this.tour = tour;
    }
    public List<Lapin> getLapin() {
        return lapin;
    }
    
    
   /*
    * Déterminer le profile de chaque joueur par nom 
    */
    @Override
    public String toString(){
        StringBuilder sb = new StringBuilder();
        sb.append("Nom: ");
        sb.append(this.getNom());
        sb.append("/n");
        sb.append("Prénom: ");
        sb.append(this.getPrenom());
        sb.append("/n");
        sb.append("Age: ");
        sb.append(this.getAge());
        sb.append("/n");
        sb.append("Email: ");
        sb.append(this.getEmail());
        sb.append("/n");
        return sb.toString();
    }
   /*
    * Déterminer le victoire du jeu
    */
    public boolean defeat(){
        return this.defeat;
    }
    public void defaillant(){
        this.defeat = true;
    }

    /**
     * @return the nom
     */
    public String getNom() {
        return nom;
    }

    /**
     * @param nom the nom to set
     */
    public void setNom(String nom) {
        this.nom = nom;
    }

    /**
     * @return the prenom
     */
    public String getPrenom() {
        return prenom;
    }

    /**
     * @param prenom the prenom to set
     */
    public void setPrenom(String prenom) {
        this.prenom = prenom;
    }

    /**
     * @return the age
     */
    public int getAge() {
        return age;
    }

    /**
     * @param age the age to set
     */
    public void setAge(int age) {
        this.age = age;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }
   

   
    
    
}
